﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace WpfApplication1
{
    class Chat : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private StringBuilder conversation = new StringBuilder();
        private List<String> user = new List<String>();
        public List<String> Users { get { return this.user; } }
        public String Log { get { return conversation.ToString(); } set { if (conversation.ToString().Equals(String.Empty))  conversation.Append(value); else conversation.Append("\u2028" + value); NotifyPropertyChanged("Log"); } }
        public List<User> Members = new List<User>();
        public Chat()
        {

        }
        public Chat(String User)
        {
            this.user.Add(User);
            
        }

        public void AddUsers(params User[] Users)
        {
            foreach (User User in Users)
            {
                Members.Add(User);
            }
        }

        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

        
    }
}
